package com.campusbackend.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 分页结果对象
 *
 * @author yezi
 * @since 2025-07-29
 */
@Data
@Schema(name = "PageResult", description = "分页结果对象")
public class PageResult<T> {

    @Schema(description = "数据列表")
    private List<T> list;

    @Schema(description = "总记录数")
    private Long total;

    @Schema(description = "当前页码")
    private Long page;

    @Schema(description = "每页数量")
    private Long size;

    public PageResult() {}

    public PageResult(List<T> list, Long total, Long page, Long size) {
        this.list = list;
        this.total = total;
        this.page = page;
        this.size = size;
    }
}
